import axios from 'axios';

export default {
  saveInvestProject (params) { // 保存投后项目
    return axios.post('/security/invest/saveInvestProject', params);
  },
  saveRiskMonitor (params) { // 保存风险监控
    return axios.post('/security/invest/saveRiskMonitor', params);
  },
  saveInvestExit (params) { // 保存退出监控
    return axios.post('/security/invest/saveInvestExit', params);
  },
  getInvestProject (projectId) { // 获取单个投后项目
    return axios.get(`/security/invest/getInvestProject?projectId=${projectId}`);
  },
  getRiskMonitor (id) { // 获取单个风险监控
    return axios.get(`/security/invest/getRiskMonitor?riskId=${id}`);
  },
  getInvestExit (id) { // 获取单个退出监控
    return axios.get(`/security/invest/getInvestExit?exitId=${id}`);
  },
  getInvestProjectList () { // 获取投后项目
    return axios.get(`/security/invest/investProjectList?pageNo=0&pageSize=100`);
  },
  getRiskMonitorList (projectId) { // 获取风险监控
    return axios.get(`/security/invest/getRiskMonitorList?projectId=${projectId}`);
  },
  getInvestExitList (projectId) { // 获取退出监控
    return axios.get(`/security/invest/investExitList?projectId=${projectId}`);
  },
  deleteInvestProject (params) { // 删除投后项目
    return axios.post('/security/invest/deleteInvestProject', params, {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    });
  },
  deleteRiskMonitor (params) { // 删除风险监控
    return axios.post('/security/invest/deleteRiskMonitor', params, {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    });
  },
  deleteInvestExit (params) { // 删除退出监控
    return axios.post('/security/invest/deleteInvestExit', params, {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    });
  }
};
